package kevin.framework.basic.common.utils;

import java.util.Properties;

import org.apache.ibatis.executor.result.DefaultResultHandler;
import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.plugin.Intercepts;
import org.apache.ibatis.plugin.Invocation;
import org.apache.ibatis.plugin.Plugin;
import org.apache.ibatis.plugin.Signature;
import org.apache.ibatis.session.ResultContext;

@Intercepts({ @Signature(type = DefaultResultHandler.class, method = "handleResult", args = { ResultContext.class }) })
public class ResultHandlerInterceptor implements Interceptor {

	@Override
	public Object intercept(Invocation invocation) throws Throwable {

		System.out.println("kevin.framework.basic.common.utils.ResultHandlerInterceptor");

		return invocation.proceed();
	}

	@Override
	public Object plugin(Object target) {
		return Plugin.wrap(target, this);
	}

	@Override
	public void setProperties(Properties properties) {
	}

}
